package com.lq.Interceptor;

import java.io.PrintWriter;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;
import org.springframework.web.servlet.HandlerInterceptor;

import com.lq.pojo.User;


@Component
public class UserInterceptor implements HandlerInterceptor{
	
	/*
	@Override
	public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)
			throws Exception {
		Users users=new Users();
		HttpSession session = request.getSession();

		users = (Users) session.getAttribute("users");

		if((!StringUtils.isEmpty(users.getName()))&&(!StringUtils.isEmpty(users.getPassword()))) {
			return true;
		}
		request.getRequestDispatcher("/hello").forward(request, response);
		return false; 
	}
	
	
	
	@Override
	public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex)
			throws Exception {
		System.out.println("之后");
	} */
}
